#!/bin/sh
set -e # fail on errors

# Redirect stderr -> stdout
exec 2>&1

cd <%= @options[:working_dir] %>

exec chpst -e <%= @options[:env_dir] %> -P \
  -U <%= @options[:user] %>:<%= @options[:groupname] %> \
  -u <%= @options[:user] %>:<%= @options[:groupname] %> \
  <%= @options[:wrapper_path] %> /opt/gitlab/embedded/bin/praefect -config <%= @options[:config_path] %>
